package com.feixiang.control;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.feixiang.service.UserService;

@Controller
@RequestMapping(value="/login")
public class LoginController {
	@Autowired
	private UserService userService;
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String login(HttpServletRequest request) {
		if (this.userService.getCurrentUser() == null) {
			return "index";
		} else {
			return "redirect:/index";
		}
	}
}
